<template>
	<view style="padding-top: 25rpx;">
		<view v-for="(item,index) in marriage" class="marriageItem font-32 font-weight" 
		:class="sclectId==item?'marriageActive':''" :key="index" @click="selectFn(item)">
			{{item}}
		</view>
		
		<view class="bomPosition">
			<button type="primary" @click="preserve">保存</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				marriage:['5万以下','5-10万','10-20万','20-30万','30-40万','40-50万','50-100万','100万以上','暂不透露'],
				sclectId:'',
				type:''
			};
		},
		onLoad(res) {
			if(res.type) {
				this.type = res.type
			}else {
				this.type = ''
			}
			this.shouruList()
		},
		methods:{
			selectFn(i) {
				this.sclectId = i
			},
			shouruList() {
				this.$api.sendRequest({
					url:'/api/Index/incomeList',
					data:{},
					success:res=>{
						
					}
				})
			},
			preserve() {
				if(this.type=='yaoqiu') {
					uni.$emit('incomeYaoqiu', this.sclectId)
					uni.navigateBack({
						delta: 1
					})
				}else {
					uni.$emit('incomeFn', this.sclectId)
					uni.navigateBack({
						delta: 1
					})
				}
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.marriageItem {
		width: 694rpx;
		margin: 25rpx auto;
		height: 112rpx;
		margin-top: 0;
		background: #F1F1F1;
		border-radius: 6rpx;
		line-height: 112rpx;
		text-align: center;
	}
	.marriageActive {
		background-color: #ff5e0f !important;
		color: #fff !important; 
	}
</style>
